<template>
  <el-dialog title="保函详情" :visible.sync="dialogVisible" width="30%" :append-to-body="true">
    <el-form ref="detailForm" :model="form" label-width="120px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="公司名称">{{form.org_name}}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="项目名称">{{form.project_name}}</el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="联系人">{{form.link_man}}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="联系电话">{{form.link_phone}}</el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="保函类型">{{form.type}}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="保函额度">{{form.money}}万元</el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="代办费用">{{form.cp_money}}元</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="尾款">{{form.backletter_money}}元</el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </el-dialog>
</template>
<script>
import { baseUrl } from "@/config/env";
const urls = {
  get: baseUrl + "/zweixin/fk/bl/get"
};
export default {
  data() {
    return {
      dialogVisible: false,
      form: {
        org_name: null,
        project_name: null,
        link_man: null,
        link_phone: null,
        type: null,
        money: null,
        cp_money: 0,
        backletter_money: 0
      }
    };
  },
  components: {},
  methods: {
    show(kid) {
      this.dialogVisible = true;
      this.fetch(kid);
    },
    fetch(kid) {
      axios.get(urls.get, { params: { kid: kid } }).then(res => {
        let data = res.data.result;
        this.form = {
          org_name: data.org_name,
          project_name: data.project_name,
          link_man: data.link_man,
          link_phone: data.link_phone,
          type: data.type,
          money: data.money,
          cp_money: data.cp_money,
          backletter_money: data.backletter_money
        };
      });
    }
  }
};
</script>